{% extends "layout" %}

{% block local %}<div id="local">

{% comment %} Resume des tests unitaires {% endcomment %}
	{% if tests %}
	{% if tests.getstatus %}<div class="pass">
	<h3 class="has_tests">Tests unitaires</h3>
		<p class="tests_pass">{{ tests.getpasscount }} tests réussis.</p>
		<p class="details"><a href="kit/{{ kit.getid }}/tests">voir le détail</a>.</p>
	</div>
	{% else %}<div class="fail">
	<h3 class="has_tests">Tests unitaires</h3>
		<p class="tests_fail">{{ tests.getfailcount }} tests en echecs.</p>
		<p class="tests_exception">{{ tests.getexceptioncount }} exceptions</p>
		<p class="details"><a href="kit/{{ kit.getid }}/tests">voir le détail</a>.</p>
	</div>{% endif %}{% endif %}

	<p><a href="kit/{{ kit.getid }}/cfg" class="cfg">Configurer le kit</a></p>

{% comment %} tools list and config {% endcomment %}
{% if kit.listtools %}	<h3>Outils du kit</h3>
	<dl class="tools">{% for tclass in kit.listtools %}
		<dt><a href="kit/{{ kit.getid }}/toolcfg/{{ forloop.key }}" class="cfg">
			{{ forloop.key }}</a></dt>
		<dd>{{ tclass }}</dd>{% endfor %}
	</dl>{% endif %}
</div>{% endblock %}

{% block main %}
	<h2>Kit {{ kit.getid }} {{ kit.getversion }} </h2>
	<p>{{ kit.getdescription }}</p>

{% switch kit.getstatus %}
	{% case "missing_kit" %}<p class="alert">Ce kit requiert des kits absents</p>{% endcase %}
	{% case "bad_php" %}<p class="alert">Ce kit n'est pas compatible avec la version courante de PHP</p>{% endcase %}
{% endswitch %}

	<p>{{ cfg.kit.desc }}</p>

	{% if kit.link %}<p><a href="{{ kit.link }}">web site</a></p>{% endif %}

	{% if kit.phpversion %}
		<p>PHP versions supported : {{ kit.phpversion }}</p>
	{% endif %}

	{% if kit.listsubkits %}<div class="subkits">
	<h3>Kits inclus</h3>
	{% include "kitlist" kits=kit.getsubkits %}</div>{% endif %}

	{% if kit.getdependencies %}<div class="dependencies">
	<h3>Kits requis</h3>
	{% include "kitlist" kits=kit.getdependencies %}{% comment %}{% endcomment %}
	</div>{% endif %}

	{% comment %}{% if cfg.load_files %}<div class="files">
	<h3>Included library files</h3>
	<dl>{% for file in cfg.load_files %}
		<dt>{{ file }}</dt>{% endfor %}
	</dl>
	</div>{% endif %}

	<!-- {{ kit|dump }} -->{% endcomment %}
{% endblock %}
